package com.zs.usc.token.redis;

import com.zs.usc.constant.Global;
import com.zs.usc.token.ITokenManager;
import com.zs.usc.utils.RedisUtils;
import com.zs.usc.vo.CurrentUserInfo;
import io.lettuce.core.RedisClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Zero
 * @description redisToken管理器
 * @date 2021/11/13 14:24
 */
@Service
public class RedisTokenManager implements ITokenManager {

    @Autowired
    private RedisUtils redisUtils;

    @Override
    public void addToken(String token, CurrentUserInfo loginUser) {

        redisUtils.set(token, loginUser, Global.TOKEN_EXPIRE);
    }

    @Override
    public CurrentUserInfo validate(String token) {
        return null;
    }
}
